<template>
  <div class="dashboard-container">
    <component :is="currentRole" />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
// 副总
import deputyGeneralDashboard from './deputy-general'
// 总监
import chiefInspectorDashboard from './chief-inspector'
// 经理
import managerDashboard from './manager'
// 主管
import executiveDirectorDashboard from './executive-director'
// 组长
import groupLeaderDashboard from './group-leader'
// 情报员
import memberDashboard from './member'

export default {
  name: 'Dashboard',
  components: { chiefInspectorDashboard, deputyGeneralDashboard, managerDashboard, executiveDirectorDashboard, groupLeaderDashboard, memberDashboard },
  data() {
    return {
      currentRole: 'memberDashboard'
    }
  },
  computed: {
    ...mapGetters([
      'roles'
    ])
  },
  created() {
    const roleCode = this.roles[0] + 'Dashboard'
    console.log(roleCode)
    this.currentRole = "memberDashboard"
  }
}
</script>
